import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";

Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
  {
    path: "/",
    redirect: "/login",
    meta: { title: "爱坤大乱斗" },
  },
  {
    path: "/login",
    component: () => import("Views/Login/index.vue"),
  },
  {
    path: "/dld",
    component: () => import("Views/ViewContainer.vue"),
    meta: ["数据管理"],
    redirect: "/dld/home",
    children: [
      {
        path: "/dld/home",
        name: "dld-home",
        meta: ["数据管理", "添加副本"],
        component: () => import("Views/Home/index.vue"),
      }
    ],
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
